package com.gu.enumeration;

/**
 * @ProjectName: apartment-management-center
 * @Package: com.gu.enumeration
 * @ClassName: UserOccupationTypeEnum
 * @Author: gusongliao
 * @Description: 用户职业：1——管理员，2——物业维修，3——业主
 * @createDate 2021/02/25 17:22
 */
public enum UserOccupationTypeEnum {

    ADMINISTRATOR(1,"管理员"),
    REPAIRMAN(2,"物业维修"),
    OWNER(3,"业主")
    ;

    /**
     * 职业代号
     */
    private Integer occupationCode;
    /**
     * 职业名称
     */
    private String occupationName;

    UserOccupationTypeEnum() {
    }

    UserOccupationTypeEnum(Integer occupationCode, String occupationName) {
        this.occupationCode = occupationCode;
        this.occupationName = occupationName;
    }

    public Integer getOccupationCode() {
        return occupationCode;
    }

    public void setOccupationCode(Integer occupationCode) {
        this.occupationCode = occupationCode;
    }

    public String getOccupationName() {
        return occupationName;
    }

    public void setOccupationName(String occupationName) {
        this.occupationName = occupationName;
    }

    public static String getUserOccupation(Integer occupationCode){
        for (UserOccupationTypeEnum value : UserOccupationTypeEnum.values()) {
            if (value.occupationCode.equals(occupationCode)){
                return value.occupationName;
            }
        }
        return "";
    }
}
